package com.modules.security;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class AuthorityIntercept extends AbstractInterceptor{

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		
		Map session = ActionContext.getContext().getSession();
		
		Object userId = session.get("userID");
		Object users = session.get("users");
		if(userId==null||users==null)
		{
			return "login";
		}
		
		return invocation.invoke();
	}

}
